package com.yypx.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Component;

import com.yypx.entity.TypeValueObject;
import com.yypx.service.CertificateTypeService;

@Component("certificateTypeService")
public class CertificateTypeServiceImpl implements CertificateTypeService {
	@Override
	public TypeValueObject findById(int typeid) {
		TypeValueObject t = new TypeValueObject();
		t.setTid(typeid);
		switch (typeid) {
		case 1:
			t.setTname("身份证");
			break;
		case 2:
			t.setTname("驾照");
			break;
		case 3:
			t.setTname("护照");
			break;
		case 4:
			t.setTname("港澳通行证");
			break;
		default:
			break;
		}
		return t;
	}

	@Override
	public List<TypeValueObject> listAll() {
		List<TypeValueObject> list = new ArrayList<TypeValueObject>();
		TypeValueObject t = new TypeValueObject();
		t.setTid(1);
		t.setTname("身份证");
		list.add(t);
		t = new TypeValueObject();
		t.setTid(2);
		t.setTname("驾照");
		list.add(t);
		t = new TypeValueObject();
		t.setTid(3);
		t.setTname("护照");
		list.add(t);
		t = new TypeValueObject();
		t.setTid(4);
		t.setTname("港澳通行证");
		list.add(t);
		return list;
	}
}
